
// init
function SnackController($scope, $log) {
    //fetch latest modified

//    $scope.items = [
//
//    ];

}


function AboutController($scope, $log) {

    $scope.bigTotalItems = 1000;

    $scope.$watch("bigCurrentPage", function() {

        console.log($scope.bigCurrentPage);

//            var pages = Math.ceil($scope.bigTotalItems / $scope.totalItems)
//            console.log("总页数" + pages);

        $scope.start_point = ($scope.bigCurrentPage -1) * $scope.totalItems + 1;

        console.log($scope.start_point);
        console.log($scope.page_size);
    })

//        $scope.totalItems = 10;
//        $scope.start = 1;
//        $scope.page_size = $scope.totalItems;
//        $scope.maxSize = 10;
//        $scope.bigTotalItems = 1000;
//        $scope.bigCurrentPage = 1;
//
//        $scope.$watch("bigCurrentPage", function() {
//
//            console.log($scope.bigCurrentPage);
//
////            var pages = Math.ceil($scope.bigTotalItems / $scope.totalItems)
////            console.log("总页数" + pages);
//
//            $scope.start = ($scope.bigCurrentPage -1) * $scope.totalItems + 1;
//
//            console.log($scope.start);
//            console.log($scope.page_size);
//        })
}

//function scopebaselineRouteConfig($routeProvider) {
//    $routeProvider.
//    when('/envs', {
//            controller: EnvController, templateUrl: 'views/env/env.html'
//        }).
//    otherwise({
//            redirectTo: '/'
//        });
//}
//
//index_app.config(scopebaselineRouteConfig);


//index_app.controller("index", function($scope, $http) {
//
//    $scope.start_point=1;
//    $scope.page_size = 10;
//    $http.get("http://10.0.0.146:8888/v1/environments?start=" + $scope.start_point + "&page_size=" + $scope.page_size).success(function(response) {
//
//        $scope.env_list = response.envs;
//        // fetch a object
//        //var root = responseXML.documentElement;
//        //var xmlDoc = loadXML(response);
//        //var version = xmlDoc.getElementsByTagName('Version')[0].innerHTML;
//        //var description = xmlDoc.getElementsByTagName('Description')[0].innerHTML;
//        //var cimaturity = xmlDoc.getElementsByTagName('CIMaturity')[0].innerHTML;
//        //var author = xmlDoc.getElementsByTagName('Author')[0].getAttribute('name')
//        //var created_time = xmlDoc.getElementsByTagName('CreatedDatetime')[0].innerHTML;
//
//        //$scope.base_info = {
//        //    "version": version,
//        //    "desc" : description,
//        //    "cimaturity" : cimaturity,
//        //    "author" : author,
//        //    "created_time" : created_time
//        //}
//
//        //// SAAS
//        //var saas = xmlDoc.getElementsByTagName('SAAS')[0];
//        //var s_components = saas.childNodes[1];
//        //var s_com_list_obj = s_components.childNodes;
//
//        //var paas = xmlDoc.getElementsByTagName('PAAS')[0];
//        //var p_components = paas.childNodes[1];
//        //var p_com_list_obj = p_components.childNodes;
//
//        //var daas = xmlDoc.getElementsByTagName('DAAS')[0];
//        //var d_components = daas.childNodes[1];
//        //var d_com_list_obj = d_components.childNodes;
//
//        ////$scope.saas_com_list = [];
//        ////$scope.paas_com_list = [];
//        ////$scope.daas_com_list = [];
//
//        //$scope.saas_com_list = getComponentList(s_com_list_obj);
//        //$scope.paas_com_list = getComponentList(p_com_list_obj);
//        //$scope.daas_com_list = getComponentList(d_com_list_obj);
//        //console.log($scope.saas_com_list);
//
//    });
//    $scope.saas_table_state = false;
//    $scope.show_saas = function() {
//        $scope.saas_table_state = !$scope.saas_table_state;
//    };
//
//    $scope.paas_table_state = false;
//    $scope.show_paas = function() {
//        $scope.paas_table_state = !$scope.paas_table_state;
//    };
//
//    $scope.daas_table_state = false;
//    $scope.show_daas = function() {
//        $scope.daas_table_state = !$scope.daas_table_state;
//    };
//
//    $scope.modal_warning_msg = "此提交会改变git源代码仓库所对应的项目,并获得提交后的commit UID!";
//    $scope.git_msg_state = false;
//    $scope.change_modal_warning_msg = function() {
//        $scope.git_msg_state = true;
//        $scope.git_msg= "commit and push success.";
//        $scope.modal_warning_msg = "commitUID: 76e7f83d773441c69d01b95e5e27e67b";
//    }
//});

